package com.xr.controller;

import com.xr.result.ResultMessages;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class BaseExceptionAdvice {

    @ExceptionHandler(Exception.class)
    public ResultMessages doOtherException(Exception ex) {
        //记录日志
        //发送消息给运维
        //发送邮件给开发人员,ex对象发送给开发人员
        ex.printStackTrace();
        return new ResultMessages(false, null, "系统错误，请稍后再试！");
    }


}
